package com.ch.home.testMapper;

import com.ch.home.bean.GameInfo;
import com.ch.home.mapper.gameMapper.GameInfoMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

/**
 * Created by CHEN on 2019/9/1.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class testGameInfoMapper {


    @Autowired
    GameInfoMapper gameInfoMapper;

//    int addResult(GameInfo gameInfo);
//    int updateResult(GameInfo gameInfo);
//    ArrayList<GameInfo> getGameResultByCondition();

    @Test
    public void testaddResult(){


        int i = gameInfoMapper.addResult(new GameInfo(null, 1, 1, 65, 2,70, new Date( ), 2,null));


        System.out.println(i);


    }


    @Test
    public void testUpdateResult(){
        int i = gameInfoMapper.updateResult(new GameInfo(1, 1, 3, 55, 6, 45, new Date( ), 1,null));

        System.out.println(i );

    }


    @Test
    public void testGetGameResultByCondition(){

        GameInfo gameInfo=new GameInfo(null,null,null,null,null,null,null,1,null);
        GameInfo gameInfo1=new GameInfo(null,null,1,null,null,null,null,null,null);
        System.out.println(gameInfoMapper.getGameResultByCondition(gameInfo1) );

    }

}
